package com.example.navigation.fragment

import android.os.Bundle
import android.view.View
import androidx.navigation.fragment.findNavController
import androidx.transition.TransitionInflater
import com.example.navigation.R
import com.example.navigation.base.BaseFragment
import kotlinx.android.synthetic.main.fragment_register.*
import kotlinx.android.synthetic.main.fragment_register.view.*

/**
 * @author Liyg
 * @description: 注册页面
 * @date :2020/11/19
 */
class RegisterFragment : BaseFragment() {

    /**
     * 布局资源
     */
    override fun getLayoutResId(): Int {
        return R.layout.fragment_register;
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        val shareElementEnterTransition = TransitionInflater.from(requireContext()).inflateTransition(R.transition.share_image)
    }

    override fun initView(rootView: View) {
        super.initView(rootView)
        //跳转到头像验证界面
        rootView.toAvatarVerifyBtn.setOnClickListener {
            findNavController().navigate(R.id.to_avatar_verify_fragment)
        }
        val userName = arguments?.getString("userName")

        rootView.regUserNameEt.setText(userName)
    }
}